/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/cat.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#ifndef __HELPER_JSP_HELPER_JSP_H__
#define __HELPER_JSP_HELPER_JSP_H__

namespace jsp2cpp
{

    class helper_jsp
    {
    public:
        helper_jsp();
        ~helper_jsp();

    protected:
        int push_data( data::LIST * pList, const char * lpszData, int nLen, enumJspType eType );
        int load_jsp( int argc, const char * argv[] );
        int parse();
        int save();

    public:
        int proc( xos_box::i_msg *& pMsg );

    public:
        data * push_item( const char * lpszData, int nLen, enumJspType eType );
        data * push_text( const char * lpszData, int nLen, enumJspType eType );
        data * push_declare( const char * lpszData, int nLen );

        data::LIST * declare();
        data::LIST * item();
        data::LIST * text();

    protected:
        const char * tab();

    protected:
        xos_box::i_big_buf * m_pBigBuf;
        xos_box::i_buf * m_pBuf;

        data::LIST m_declare_list;
        data::LIST m_text_list;
        data::LIST m_item_list;

        std::string m_dst_file;
        enumJspType m_eType;

        std::string m_tab;
    };

} // jsp2cpp

#endif // __HELPER_JSP_HELPER_JSP_H__
